
<html><HEAD>
<LINK REL=STYLESHEET HREF="default.css" TYPE="text/css">
<TITLE>
Using the RichTextEdit control</TITLE>
</HEAD>
<BODY>

<!-- Header -->
<p class="ancestor" align="right"><A HREF="pbugp254.htm">Previous</A>&nbsp;&nbsp;<A HREF="pbugp256.htm" >Next</A>
<!-- End Header -->
<A NAME="CIHBGCAEM"></A><h1>Using the RichTextEdit control</h1>
<A NAME="TI8937"></A><p>You can add a RichTextEdit control to a window to enhance
your application with word processing capabilities. </p>
<A NAME="TI8938"></A><p>Users can enter text in a RichTextEdit control, format it,
save it to a file, and print it. You can also enable a pop-up menu
from which users can control the appearance of the control and import
documents.</p>
<A NAME="TI8939"></A><p><img src="images/proc.gif" width=17 height=17 border=0 align="bottom" alt="Steps"> To add a RichTextEdit control to a window:</p>
<ol><li class=fi><p>In the Window painter, select Insert&gt;Control&gt;RichTextEdit
and click the window.</p></li></ol>
<br><A NAME="TI8940"></A><h4>Controlling the appearance of a RichTextEdit
control</h4>
<A NAME="TI8941"></A><p>You modify the appearance of a RichTextEdit control by setting
its properties. Some of the properties you can set are:<A NAME="TI8942"></A>
<ul>
<li class=fi>The toolbars that appear in
the control</li>
<li class=ds>The visibility of nonprinting characters and graphics
</li>
</ul>
</p>
<A NAME="TI8943"></A><p><img src="images/proc.gif" width=17 height=17 border=0 align="bottom" alt="Steps"> To control the appearance of a RichTextEdit control:</p>
<ol><li class=fi><p>Select the control, then select the Document
tab in the Properties view.</p></li>
<li class=ds><p>Choose the appropriate properties to display toolbars.</p></li>
<li class=ds><p>Choose the appropriate properties if you want
to display nonprinting characters such as tabs, spaces, and returns.</p><p>For information about other options on the Document properties
page, select Help from the property page's pop-up menu.</p></li></ol>
<br><A NAME="TI8944"></A><h4>Making a RichTextEdit control read-only</h4>
<A NAME="TI8945"></A><p>There are times when you might want to import a file into
the RichTextEdit control and not give the user the opportunity to
alter it. You can make a control read-only by setting the Enabled
and Popup Menu properties.</p>
<A NAME="TI8946"></A><p><img src="images/proc.gif" width=17 height=17 border=0 align="bottom" alt="Steps"> To make a RichTextEdit control read-only:</p>
<ol><li class=fi><p>Select the control, then select the General
tab in the Properties view.</p></li>
<li class=ds><p>Make sure the Enabled check box is cleared.</p></li>
<li class=ds><p>Select the Document tab.</p></li>
<li class=ds><p>Make sure the PopMenu check box is cleared.</p></li></ol>
<br><A NAME="TI8947"></A><h4>Enabling the pop-up menu</h4>
<A NAME="TI8948"></A><p>If you enable the pop-up menu property, users can customize
the appearance of the RichTextEdit control.</p>
<A NAME="TI8949"></A><p>From the pop-up menu, users can:<A NAME="TI8950"></A>
<ul>
<li class=fi>Perform
editing tasks (cut, copy, paste, and clear)</li>
<li class=ds>Insert a file into the RichTextEdit control</li>
<li class=ds>Display and modify the Rich Text Object dialog box<br><img src="images/rt07.gif">
<br>
The General property page on the user's Rich Text
Object dialog box presents many of the same options as the Document
property page in the development environment.<br>
</li>
</ul>
</p>
<A NAME="TI8951"></A><p>For more information about the RichTextEdit
control, see the chapter on implementing rich text in <i>Application
Techniques</i>
.</p>

